﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Huioo.Learning.Serilog.ConsoleApp.App
{
    public class DataService : IDataService
    {
        private readonly ILogger<DataService> _log;
        private readonly IConfiguration _config;

        public DataService(ILogger<DataService> log, IConfiguration config)
        {
            _log = log;
            _config = config;
        }

        public void Connect()
        {
            // 读取连接字符串
            var connString = _config.GetValue<string>("ConnectionStrings:DefaultConnection");

            _log.LogInformation("Connection String {cs}", connString);
        }
    }
}
